<template>
	<view :style="themeColor">
		<view class="page">
			<view class="flex benben-position-layout flex flex-wrap align-center forgotPasswordPage_flex_0"
				:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
				<view class='flex flex-wrap align-center justify-between flex-sub forgotPasswordPage_fd0_0'>
					<view class='flex flex-wrap align-center forgotPasswordPage_fd0_0_c0' @tap.stop="handleJumpDiy"
						data-type="back" data-url="1">
						<text class='fu-iconfont2  forgotPasswordPage_fd0_0_c0_c0'>&#xE794;</text>
					</view>
					<view class='flex flex-wrap align-center justify-end forgotPasswordPage_fd0_0_c0'>
					</view>
				</view>

			</view>
			<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
			<!---flex布局flex布局开始-->
			<view class="flex flex-direction flex-wrap align-center benben-flex-layout forgotPasswordPage_flex_1">
				<image class='forgotPasswordPage_fd1_0' mode="aspectFit" :src='STATIC_URL+"142.png"'></image>
				<text class='forgotPasswordPage_fd1_1'>鑫林商学院</text>
			</view>

			<!---flex布局flex布局结束-->
			<!---flex布局flex布局开始-->
			<view class="flex flex-direction flex-wrap align-stretch benben-flex-layout forgotPasswordPage_flex_2">
				<view class='flex flex-wrap align-center forgotPasswordPage_fd2_0'>
					<image class='forgotPasswordPage_fd2_0_c0' mode="aspectFit" :src='STATIC_URL+"138.png"'></image>
					<benben-input class='flex-sub forgotPasswordPage_fd2_0_c1' type="number" :placeholder="`请输入手机号`"
						confirm-type="done" :maxlength="11" placeholder-style="color:#999;font-size:32rpx"
						v-model="mobile" />
				</view>
				<view class='flex flex-wrap align-center forgotPasswordPage_fd2_1'>
					<image class='forgotPasswordPage_fd2_0_c0' mode="aspectFit" :src='STATIC_URL+"143.png"'></image>
					<benben-input class='flex-sub forgotPasswordPage_fd2_0_c1' type="number" :placeholder="`请输入验证码`"
						confirm-type="done" :maxlength="4" placeholder-style="color:#999;font-size:32rpx"
						v-model="code" />
					<benben-send-verification-code key='1701480848223' ref="vCode1701480848223"
						class=' forgotPasswordPage_fd2_1_c2' after-text='后重新获取' before-text='获取验证码' type='2'
						:phone="mobile"></benben-send-verification-code>
				</view>
				<view class='flex flex-wrap align-center forgotPasswordPage_fd2_1'>
					<image class='forgotPasswordPage_fd2_0_c0' mode="aspectFit" :src='STATIC_URL+"139.png"'></image>
					<benben-flex-password-diy v-model="password"
						class-name="flex flex align-center forgotPasswordPage_fd2_2_c1"
						:placeholder="'请输入密码(6~12位字母+数字)'" :maxlength="12" :default-type='true'
						placeholder-style="color:#999;font-size:32rpx">
						<template #show>
							<!-- <text class='fu-iconfont2  forgotPasswordPage_fd2_2_c1_icon1'
								data-type="show">&#xe693;</text> -->
							<image style="width: 48rpx;height: 48rpx;" data-type="show" :src='STATIC_URL+"1.png"' mode=""></image>
						</template>
						<template #hide>
							<!-- <text class='fu-iconfont2  forgotPasswordPage_fd2_2_c1_icon2'
								data-type="hide">&#xEBCC;</text> -->
							<image style="width: 48rpx;height: 48rpx;" data-type="hide" :src='STATIC_URL+"2.png"' mode=""></image>
						</template>
					</benben-flex-password-diy>
				</view>
				<button class='forgotPasswordPage_fd2_3' @tap.stop="forgetpswdFunc()">确定</button>
			</view>

			<!---flex布局flex布局结束-->


		</view>
	</view>
</template>
<script>
	import {
		validate
	} from '@/common/utils/validate.js'

	export default {
		components: {},


		data() {
			return {
				"mobile": "",
				"code": "",
				"password": "",
				"is_submit": false,
			};
		},
		computed: {
			themeColor() {
				return this.$store.getters.themeColor
			},

		},
		watch: {},
		onLoad(options) {

		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {

		},
		onHide() {

		},
		onResize() {

		},
		onPullDownRefresh() {

		},
		onReachBottom(e) {

		},
		onPageScroll(e) {

		},
		methods: {
			//忘记密码
			async forgetpswdFunc() {
				if (this.is_submit) return;
				if (!validate(this.mobile, 'require')) {
					this.$message.info('请输入手机号');
					return false;
				}
				if (!validate(this.mobile, 'phone')) {
					this.$message.info('请输入正确的手机号');
					return false;
				}
				if (!validate(this.code, 'require')) {
					this.$message.info('请输入验证码');
					return false;
				}
				if (!validate(this.code, 'captcha')) {
					this.$message.info('请输入正确的验证码');
					return false;
				}
				if (!validate(this.password, 'require')) {
					this.$message.info('请输入密码');
					return false;
				}
				if (!validate(this.password, 'password')) {
					this.$message.info('请输入正确的密码(6~12位字母+数字)');
					return false;
				}
				//请求方法
				//数据验证
				this.is_submit = true;
				let data5caeeba9866aa = await this.$api.post(global.apiUrls.post5caeeba9866aa, {
					password: this.password,
					account: this.mobile,
					code: this.code,
					type: '2',
					account_type: 'mobile'
				});

				if (data5caeeba9866aa.data.code != 1) {
					this.is_submit = false;
					this.$message.info(data5caeeba9866aa.data.msg);
					return
				}

				this.$message.info(data5caeeba9866aa.data.msg);
				setTimeout(() => {
					this.is_submit = false;
					this.$urouter.redirectTo(`/pages/tabBar/loginPage/loginPage`);
				}, 800)
			}
		}
	};
</script>
<style lang="scss" scoped>
	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background: url(image-path('137.png')) no-repeat;
		background-size: 100% auto;
	}

	.forgotPasswordPage_flex_0 {
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
	}

	.forgotPasswordPage_fd0_0_c0_c0 {
		font-size: 36rpx;
		color: #333;
	}

	.forgotPasswordPage_fd0_0_c0 {
		width: 120rpx;
	}

	.forgotPasswordPage_fd0_0 {
		padding: 0rpx 32rpx 0rpx 32rpx;
	}

	.forgotPasswordPage_flex_1 {
		padding: 88rpx 0rpx 0rpx 0rpx;
	}

	.forgotPasswordPage_fd1_1 {
		color: #333333;
		font-size: 32rpx;
		font-weight: 500;
		line-height: 45rpx;
		margin: 38rpx 0rpx 40rpx 0rpx;
	}

	.forgotPasswordPage_fd1_0 {
		width: 160rpx;
		height: 160rpx;
		border-radius: 33rpx 33rpx 33rpx 33rpx;
	}

	.forgotPasswordPage_flex_2 {
		padding: 0rpx 56rpx 0rpx 56rpx;
	}

	.forgotPasswordPage_fd2_3 {
		background: #E60012;
		font-size: 32rpx;
		color: var(--benbenFontColor3);
		width: 640rpx;
		height: 80rpx;
		line-height: 80rpx;
		margin: 100rpx 0rpx 32rpx 0rpx;
	}

	.forgotPasswordPage_fd2_2_c1_icon2 {
		width: 88rpx;
		line-height: 88rpx;
		text-align: center;
		font-size: 40rpx;
	}

	.forgotPasswordPage_fd2_2_c1_icon1 {
		width: 88rpx;
		line-height: 88rpx;
		text-align: center;
		font-size: 30rpx;
		color: rgba(191, 191, 191, 1);
	}

	::v-deep .forgotPasswordPage_fd2_2_c1 {
		height: 45rpx;
		width: 550rpx;
		font-size: 32rpx;
		margin: 0rpx 0rpx 0rpx 32rpx;
	}

	.forgotPasswordPage_fd2_1_c2 {
		line-height: 40rpx;
		font-size: 28rpx;
		color: rgba(67, 154, 236, 1);
		font-weight: 400;
	}

	.forgotPasswordPage_fd2_1 {
		border-bottom: 1px solid #eee;
		padding: 40rpx 0rpx 40rpx 0rpx;
	}

	.forgotPasswordPage_fd2_0_c1 {
		height: 45rpx;
		margin: 0rpx 0rpx 0rpx 32rpx;
		color: var(--benbenFontColor0);
		font-size: 32rpx;
		font-weight: 400;
		line-height: 45rpx;
	}

	.forgotPasswordPage_fd2_0_c0 {
		width: 48rpx;
		height: 48rpx;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
	}

	.forgotPasswordPage_fd2_0 {
		border-bottom: 1px solid #eee;
		padding: 40rpx 0rpx 40rpx 0rpx;
		margin: 40rpx 0rpx 0rpx 0rpx;
	}
</style>